package model

import (
	"vueAdmin/application/utils"
)

func GetToken(username string, password string) string {
	password = utils.Md5(password)
	data := Orm.Table("sys_user").
		Field("id").
		Where("username", "=", username, "and").
		Where("password", "=", password, "and").
		Find()
	if len(data) != 0 {
		return data["id"]
	}

	return ""
}
